﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace TestForm
{
    public class TestControl : Control
    {
        public TestControl()
        {

        }
        [Editor(typeof(FlagEnumUIEditor), typeof(System.Drawing.Design.UITypeEditor))]
        public TestFlagEnum EnumFlag
        {
            set { _EnumFlag = value; }
            get { return _EnumFlag; }
        }
        TestFlagEnum _EnumFlag =TestFlagEnum.A|TestFlagEnum.B;

        TestEnum testEnum;
        [Editor(typeof(FlagEnumUIEditor), typeof(System.Drawing.Design.UITypeEditor))]
        public TestEnum TestEnumProperty
        {
            get
            {
                return testEnum;
            }
            set
            {
                testEnum = value;
            }
        }
    }
    [Flags]
    public enum TestFlagEnum : byte
    {
        A = 0b00_00_00_01,
        B = 0b00_00_00_10,
        C = 0b00_00_01_00,
        D = 0b00_00_10_00
    }
    [Flags]
    public enum TestEnum
    {
        None,
        Left = 1,
        Right = 2,
        Bottom = 4,
        Top = 8,
        TopLeft = Top | Left,
        BottomRight = Bottom | Right,
        All = Left | Right | Bottom | Top,


    }
}
